package com.biz.primus.management.promotion.feign;

import com.biz.primus.base.vo.PageVo;
import com.biz.primus.common.vo.SpringPageVO;
import com.biz.primus.model.promotion.vo.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author david-liu
 */
@FeignClient(value = "service-promotion")
public interface PromotionFeignClient {

    /**
     * 更新简单特价活动
     *
     * @param vo 特价活动vo
     * @return boolean
     */
    @PostMapping(value = "/soa/promotion/management/updateSpecialOfferPromotion")
    Boolean updateSpecialOfferPromotion(@RequestBody SpecialOfferPromotionVo vo);

    /**
     * 获取简单特价活动列表
     *
     * @param pageVo 分页对象
     * @return 特价活动列表
     */
    @PostMapping(value = "/soa/promotion/management/getSpecialOfferPromotions")
    SpringPageVO<SpecialOfferPromotionVo> getSpecialOfferPromotions(@RequestBody PageVo pageVo);

    /**
     * 获取简单特价活动信息
     *
     * @param promotionId 活动ID
     * @return 简单特价活动信息
     */
    @GetMapping(value = "/soa/promotion/management/getSpecialOfferPromotion")
    SpecialOfferPromotionVo getSpecialOfferPromotion(@RequestParam("promotionId") Long promotionId);

    /**
     * 切换简单特价活动状态
     *
     * @param promotionId 活动ID
     * @return Boolean
     */
    @GetMapping(value = "/soa/promotion/management/toggleSpecialOfferPromotionStatus")
    Boolean toggleSpecialOfferStatus(@RequestParam("promotionId") Long promotionId);

    /**
     * 更新首单立减活动(如果不存在, 新建)
     *
     * @param vo 首单立减活动Vo
     * @return boolean
     */
    @PostMapping(value = "/soa/promotion/management/updateUserFirstOrderPromotion")
    Boolean updateUserFirstOrderPromotion(@RequestBody UserFirstOrderCutPromotionVo vo);

    /**
     * 获取首单立减活动列表
     *
     * @param pageVo 分页对象
     * @return 首单立减活动列表
     */
    @PostMapping(value = "/soa/promotion/management/getUserFirstOrderPromotions")
    SpringPageVO<UserFirstOrderCutPromotionVo> getUserFirstOrderPromotions(@RequestBody PageVo pageVo);

    /**
     * 获取首单立减活动
     *
     * @param promotionId 活动ID
     * @return 首单立减活动
     */
    @GetMapping(value = "/soa/promotion/management/getUserFirstOrderPromotion")
    UserFirstOrderCutPromotionVo getUserFirstOrderPromotion(@RequestParam("promotionId") Long promotionId);

    /**
     * 切换用户首单立减启用状态
     *
     * @param promotionId 活动ID
     * @return boolean
     */
    @GetMapping(value = "/soa/promotion/management/toggleUserFirstOrderStatus")
    Boolean toggleUserFirstOrderStatus(@RequestParam("promotionId") Long promotionId);

    /**
     * 更新买赠满赠促销
     *
     * @param vo 买赠满赠促销Vo
     * @return boolean
     */
    @PostMapping(value = "/soa/promotion/management/updatePurchaseGiftPromotion")
    Boolean updatePurchaseGiftPromotion(@RequestBody PurchaseGiftPromotionVo vo);

    /**
     * 获取买赠满赠促销列表信息
     *
     * @param pageVo 分页对象
     * @return 促销信息列表
     */
    @PostMapping(value = "/soa/promotion/management/getPurchaseGiftPromotions")
    SpringPageVO<PurchaseGiftPromotionVo> getPurchaseGiftPromotions(@RequestBody PageVo pageVo);

    /**
     * 获取买赠满赠促销信息
     *
     * @param promotionId 活动ID
     * @return 促销信息
     */
    @GetMapping(value = "/soa/promotion/management/getPurchaseGiftPromotion")
    PurchaseGiftPromotionVo getPurchaseGiftPromotion(@RequestParam("promotionId") Long promotionId);

    /**
     * 切换买赠满赠状态
     *
     * @param promotionId 活动ID
     * @return boolean
     */
    @GetMapping(value = "/soa/promotion/management/togglePurchaseGiftPromotionStatus")
    Boolean togglePurchaseGiftPromotionStatus(@RequestParam("promotionId") Long promotionId);

    /**
     * 更新折扣促销
     *
     * @param vo 折扣促销Vo
     * @return boolean
     */
    @PostMapping(value = "/soa/promotion/management/updateDiscountPromotion")
    Boolean updateDiscountPromotion(@RequestBody DiscountPromotionVo vo);

    /**
     * 获取折扣促销列表信息
     *
     * @param pageVo 分页对象
     * @return 折扣促销列表
     */
    @PostMapping(value = "/soa/promotion/management/getDiscountPromotions")
    SpringPageVO<DiscountPromotionVo> getDiscountPromotions(@RequestBody PageVo pageVo);

    /**
     * 获取折扣促销信息
     *
     * @param promotionId 活动ID
     * @return 折扣促销信息
     */
    @GetMapping(value = "/soa/promotion/management/getDiscountPromotion")
    DiscountPromotionVo getDiscountPromotion(@RequestParam("promotionId") Long promotionId);

    /**
     * 切换折扣促销状态
     *
     * @param promotionId 活动ID
     * @return boolean
     */
    @GetMapping(value = "/soa/promotion/management/toggleDiscountPromotionStatus")
    Boolean toggleDiscountPromotionStatus(@RequestParam("promotionId") Long promotionId);

    /**
     * 更新降价拍促销
     *
     * @param vo 降价拍促销Vo
     * @return boolean
     */
    @PostMapping(value = "/soa/promotion/management/updateCutPriceSalePromotion")
    Boolean updateCutPriceSalePromotion(@RequestBody CutPriceSalePromotionVo vo);

    /**
     * 获取降价拍促销列表信息
     *
     * @param pageVo 分页对象
     * @return 促销信息列表
     */
    @PostMapping(value = "/soa/promotion/management/getCutPriceSalePromotions")
    SpringPageVO<CutPriceSalePromotionVo> getCutPriceSalePromotions(@RequestBody PageVo pageVo);

    /**
     * 获取降价拍促销信息
     *
     * @param promotionId 活动ID
     * @return 促销信息
     */
    @GetMapping(value = "/soa/promotion/management/getCutPriceSalePromotion")
    CutPriceSalePromotionVo getCutPriceSalePromotion(@RequestParam("promotionId") Long promotionId);

    /**
     * 切换降价拍促销状态
     *
     * @param promotionId 活动ID
     * @return boolean
     */
    @GetMapping(value = "/soa/promotion/management/toggleCutPriceSalePromotionStatus")
    Boolean toggleCutPriceSalePromotionStatus(@RequestParam("promotionId") Long promotionId);
}
